home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-30 | 2.1 KB | 45 lines | [TEXT/R*ch] |
- Name: CChoicesButton
- Version: 1.0
- Category: classes
- Contributor: Michael Abramowicz <MBABRAMOWICZ@AMHERST.EDU>
- Date: 93-07-06
- TCL-Version: 1.1.3
- TCL-Language: C++
- Copyright: Copyright (C) 1993 Michael Abramowicz. All rights reserved.
-
- The ChoicesButton Class
-
- A button that can make a window/dialog bigger ("More Choices") or
- smaller ("Fewer Choices"). When More Choices is clicked, a range of
- view items, set with the SetViewsToHide method, will be hidden. Another
- range of items, specified with the SetViewsToMoveUp method, will move
- upwards so that the top of the highest of the items to be moved
- is where the highest of the items that were hidden was.
- The bottom of the window enclosing the items will move up as
- well. These effects will be reversed when the button is hit again.
- This approach allows you to have a choices button that hides items
- in the middle of the dialog window.
-
- Ordinarily, you will have at least one item to be moved up, the choices
- button itself. However, if the choices button for some reason is on the
- top of the dialog, and the items to be hidden are at the bottom, then
- to ensure that the window itself shrinks when items are hidden, you should
- add an invisible item to the window, such that the top of the item is the
- bottom of the lowest item that you want hidden. Then specify this item as
- the only item to be moved up.
-
- If you wish the ChoicesButton dialog to do more than simply hide and
- move items (for example, you want some items to change into other items,
- or you want a whole new dialog setup) then you can override this class’s
- DoFewerChoices and DoMoreChoices methods.
-
- You can create such a button in three ways: through a control template,
- dynamically, or through an overloaded dialog item. With only the last
- of these methods can you specify in the resource file the views that
- should be hidden and moved up.
-
- You should always create a window in the more choices state (i.e., so
- that the button reads "Fewer Choices"). If you want the window to be
- in the fewer choices state initially, then call the DoFewerChoices
- method before the window becomes visible.
-